#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__author__ = 'teffy'

'''
@filename test
@@created on 2017-12-17
@poject:work-kit
@auther:teffy
'''

def test_ping():
    import subprocess

    cmd = 'ping -c4 www.baidu.com'
    seconds = 5
    process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
    while process.poll() is None:
        result = process.stdout.read()
        print(result.decode('utf-8'))


def test_db():
    from dbutil import DBUtil
    with  DBUtil() as dbutil:
        dbutil.cursor.execute('INSERT INTO commands VALUES (1,0,"adb","devices")')

if __name__ == '__main__':
    test_db()